<template>
	<view>
		<template v-if="deleteAccountType != 1">
			<view class="content">
				<view v-html="accountDelete"></view>
				<view class="delete-button" @click="clickDelete">
					注销账户
				</view>
			</view>
		</template>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				deleteAccountType:1,//是否启用-注销功能
				deleteAccountTodo:7,//注销功能-注销缓冲期
				accountDelete:""//注销说明
			}
		},
		onLoad() {
			this.getAccount();
		},
		methods: {
			// 账号信息
			getAccount(){
				this.$_Request(
					"GET","/api/v2/account/detail",
					{
						
					},
					(res) => {
						this.getConfigs();
					}
				)
			},
			// 配置信息
			getConfigs(){
				this.$_Request(
					"GET","/api/v2/global/configs",
					{
						"keys":"delete_account_type,delete_account_todo,account_delete"
					},
					(res) => {
						if(res.data.data.delete_account_type != 1){
							this.deleteAccountType = res.data.data.delete_account_type;
							this.deleteAccountTodo = res.data.data.delete_account_todo;
							this.accountDelete = res.data.data.account_delete;
						}else{
							uni.showToast({
								title: "未开启注销功能",
								icon: "none",
								duration: 2000
							});
							setTimeout(()=>{
								uni.navigateBack()
							},1000);
						}
					}
				)
			},
			clickDelete(){
				uni.showToast({
					title: "成功，撤回请联系管理员",
					icon: "none",
					duration: 2000
				});
			},
		}
	}
</script>

<style lang="scss">
.content{
	margin: 25rpx;
	p{
		margin-top: 20rpx;
	}
}
.delete-button{
	width: 200rpx;
	height: 80rpx;
	display: flex;
	align-items: center;
	justify-content: center;
	background: $HongSe;
	color: #FFF;
	border-radius: 10rpx;
	margin: 25rpx auto;
}
</style>
